#include "umapi_os.h"
#include "umapi_libc.h"
#include "umapi_socket.h"

UM_S32 main(UM_S32 argc, UM_CHAR **argv)
{
	if(argc <3)
		{
			printf("copyFile src n\n");
			return 0;
		}
	UM_HANDLE rf,wf;
	umapi_file_fopen(argv[1], "rb", &rf);
	umapi_file_fopen("123","wb", &wf);
	UM_U8 buff[1024];
	UM_S32 len;
	UM_S32 num = umapi_atoi(argv[2]);
	while (num >0)
	{
		while((len = umapi_file_fread(buff, 1, 1024, rf)) > 0)
		{
			umapi_file_fwrite(buff, 1, len, wf);
		}
		umapi_file_fseek(rf, 0, 0);
		num--;
	}
	umapi_file_flush(wf);
	return 0;
}

